package com.wangjie;

import org.junit.Test;

import java.util.Arrays;

public class Demo01 {
    @Test
    public void test() {
        int[] array = {1, 2, 3, 4, 5};
        System.out.print("[");
        for (int i = 0; i < array.length; i++) {
            if (i == array.length - 1) {
                System.out.print(array[i] + "]");
            } else {
                System.out.print(array[i] + ",");
            }
        }
    }

    @Test
    public void test02(){
        int[] array = {1, 2, 3, 4, 5};
        System.out.println(Arrays.toString(array));
    }
}
